package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.AnnualSafetyTrainingMapper;
import com.ruoyi.yanjing.domain.AnnualSafetyTraining;
import com.ruoyi.yanjing.service.IAnnualSafetyTrainingService;

/**
 * 年度安全培训信息Service业务层处理
 * 
 * @author whz
 * @date 2024-12-04
 */
@Service
public class AnnualSafetyTrainingServiceImpl implements IAnnualSafetyTrainingService 
{
    @Autowired
    private AnnualSafetyTrainingMapper annualSafetyTrainingMapper;

    /**
     * 查询年度安全培训信息
     * 
     * @param id 年度安全培训信息主键
     * @return 年度安全培训信息
     */
    @Override
    public AnnualSafetyTraining selectAnnualSafetyTrainingById(Long id)
    {
        return annualSafetyTrainingMapper.selectAnnualSafetyTrainingById(id);
    }

    /**
     * 查询年度安全培训信息列表
     * 
     * @param annualSafetyTraining 年度安全培训信息
     * @return 年度安全培训信息
     */
    @Override
    public List<AnnualSafetyTraining> selectAnnualSafetyTrainingList(AnnualSafetyTraining annualSafetyTraining)
    {
        return annualSafetyTrainingMapper.selectAnnualSafetyTrainingList(annualSafetyTraining);
    }

    /**
     * 新增年度安全培训信息
     * 
     * @param annualSafetyTraining 年度安全培训信息
     * @return 结果
     */
    @Override
    public int insertAnnualSafetyTraining(AnnualSafetyTraining annualSafetyTraining)
    {
        annualSafetyTraining.setCreateTime(DateUtils.getNowDate());
        return annualSafetyTrainingMapper.insertAnnualSafetyTraining(annualSafetyTraining);
    }

    /**
     * 修改年度安全培训信息
     * 
     * @param annualSafetyTraining 年度安全培训信息
     * @return 结果
     */
    @Override
    public int updateAnnualSafetyTraining(AnnualSafetyTraining annualSafetyTraining)
    {
        annualSafetyTraining.setUpdateTime(DateUtils.getNowDate());
        return annualSafetyTrainingMapper.updateAnnualSafetyTraining(annualSafetyTraining);
    }

    /**
     * 批量删除年度安全培训信息
     * 
     * @param ids 需要删除的年度安全培训信息主键
     * @return 结果
     */
    @Override
    public int deleteAnnualSafetyTrainingByIds(Long[] ids)
    {
        return annualSafetyTrainingMapper.deleteAnnualSafetyTrainingByIds(ids);
    }

    /**
     * 删除年度安全培训信息信息
     * 
     * @param id 年度安全培训信息主键
     * @return 结果
     */
    @Override
    public int deleteAnnualSafetyTrainingById(Long id)
    {
        return annualSafetyTrainingMapper.deleteAnnualSafetyTrainingById(id);
    }
}
